<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<div id="test">

</div>

<div id="test2">

</div>

<script>
    let htmllet = '{{ api }}';
    console.log(htmllet);
document.getElementById("test").innerHTML = htmllet;
let str = document.getElementById("test");
document.getElementById("test").innerHTML = str.innerText;
console.log(str);
</script>

</html>